import { Random } from 'mockjs'
import moment from 'dayjs'
export default [
  {
    method: 'GET',
    url: '/admin/users',
    request: {
    },
    response: {
      'list|10': [
        {
          name: '@name',
          username: '@name',
          'roles|1': [['super_admin', 'admin'], ['super_admin'], ['admin'], ['user']],
          snapshot: '@image("200x200", "#894FC4", "#FFF", "png", "snapshot")',
          'favs|+10': 10,
          'isTop|1': ['0', '1'],
          'status|1': ['0', '1'],
          'isVip|1': ['0', '1'],
          created: function () {
            return moment().subtract(Random.natural(1, 10), 'days').format('YYYY-MM-DD HH:mm:ss')
          }
        }
      ],
      'total|20-100': 1
    }
  },
  {
    method: 'GET',
    url: '/admin/getRolesNames',
    request: {
    },
    response: {
      list: [
        { name: 'super_admin', role: 'super_admin' },
        { name: 'admin', role: 'admin' },
        { name: 'user', role: 'user' }
      ]
    }
  }
]
